<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Progressive Loading Example</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAASI0kCI-azC8RgbOZzWc3VRRarOQe_TKf_51Omf6UUSOFm7EABRRhO0PO4nBAO9FCmVDuowVwROLo3w"
      type="text/javascript"></script>
    <script type="text/javascript" src="../lib/jquery-1.6.2.min.js"></script>
    <script type="text/javascript" src="../lib/mxn/mxn.js?(google)"></script>
    <script type="text/javascript" src="../lib/timeline-2.3.0.js"></script>
    <script src="../src/timemap.js" type="text/javascript"></script>
    <script src="../src/loaders/json.js" type="text/javascript"></script>
    <script src="../src/loaders/progressive.js" type="text/javascript"></script>
	<script type="text/javascript">
	
	var params = "?start=[start]$end=[end]&callback=?";
	var server_url = "http://localhost/~mingxuanli/syd-traffic/traffic-timeline/app/server/progsvc.php"+params;

var tm;
$(function() {
    tm = TimeMap.init({
        mapId: "map",               // Id of map div element (required)
        timelineId: "timeline",     // Id of timeline div element (required) 
        options: {
            eventIconPath: "../images/",
            mapZoom: 13,
            mapType: "normal",
        },
        datasets: [
            {
                title: "Progressive Dataset",
                theme: "red",
                type: "progressive",
                options: {
                    // Data to be loaded in JSON from a remote URL
                    type: "json", 
                    // url with start/end placeholders
                    url: server_url,
                    // start of initial date range
                    start: "2012-11-12 00:00:00",
                    // lower cutoff date for data
                    dataMinDate: "2012-11-12 00:00:00",
                    // higher cutoff date for data
                    dataMaxDate: "2012-11-30 23:59:59",
                    // four months in milliseconds
                    interval: 10368000000,   
                    // function to turn date into string appropriate for service
                    formatDate: function(d) {
                        return TimeMap.util.formatDate(d, 1);
                    }
                }
            }
        ],
        bandIntervals: [
        	Timeline.DateTime.HOUR,
        	Timeline.DateTime.DAY
        ]
    });
});
    </script>
    <link href="examples.css" type="text/css" rel="stylesheet"/>
    <style>
    div#mapcontainer{ height: 500px; }
     div#timelinecontainer{ height: 500px; }
    </style>
  </head>

  <body>
    <div id="help">
    <h1>Timeline Visualisation</h1>
   	This demo shows sydney traffic data which starts from 12 Nov to 30 Nov, then build timeline using our integrated <a href="">traffic metadata</a><br><a href="">see the PHP code here.</a>
    </div>
    <div id="timemap">
        <div id="mapcontainer">
          <div id="map"></div>
        </div>
        <div id="timelinecontainer">
          <div id="timeline"></div>
        </div>
    </div>
  </body>
</html>
